import { request } from "network/request";
export function getDetailsData(iid){
  return request({
    url:'/detail',
    params:{
      iid
    }
  })
}
export function recommend(){
  return request({
    url:'/recommend'
  })
}
export class getGoodsDetailsInfo{
  constructor(itemInfo,columns,services){
    this.title = itemInfo.title
    this.desc = itemInfo.desc
    this.newPrice = itemInfo.price
    this.oldPrice = itemInfo.oldPrice
    this.discount = itemInfo.discountDesc
    this.discountBgColor = itemInfo.discountBgColor
    this.columns = columns
    this.services = services
    this.realPrice = itemInfo.lowNowPrice
  }
}
export class getShopInfo{
  constructor(shopInfo){
    this.logo = shopInfo.shopLogo
    this.name = shopInfo.name
    this.fans = shopInfo.cFans
    this.sells = shopInfo.cSells
    this.score = shopInfo.score
    this.goodsCount = shopInfo.cGoods
  }
}
export class goodsParams{
  constructor(info,rule){
    this.image = info.image?info.image[0]:0
    this.infos = info.set
    this.sizes = rule.tables
  }
}
export class comment{
  constructor(rate){
    this.cRate = rate.cRate
    this.list = rate.list
    this.content = rate.list ? rate.list[0].content : ''
    this.time = rate.list ? rate.list[0].created : ''
    this.style = rate.list ? rate.list[0].style : ''
    this.images = rate.list ? rate.list[0].images : []
    this.username = rate.list ? rate.list[0].user.uname : ''
    this.userimg = rate.list ? rate.list[0].user.avatar : ''
  }
}
